<?php

namespace app\api\service\pay;

use app\api\model\Order;
use app\common\enum\order\OrderStatus;
use app\common\enum\order\PayStatus;

class DiscountOrderPay extends PaySuccess
{

    public function onSuccess(array $payment, int $payType)
    {
        Order::update([
            'pay_status' => PayStatus::SUCCESS,
            'transaction_id' => $payment['transaction_id'],
            'order_status' => OrderStatus::NORMAL,
            'pay_time' => time()
        ], ['order_no' => $payment['order_no']]);
    }

    public function callSuccess()
    {
        // TODO: Implement callSuccess() method.
    }
}